import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-05-25
 * Time: 13:04
 */
public class Test {
    public static long fun1(int n){
        long sum=0;
        int a=1;
        for (int i = 1; i <= n; i++) {
            a*=i;
            sum+=a;
        }
        return sum;
    }
    public static long fun(int n){
        if(n==1)
            return 1;
        return n*fun(n-1);
    }
    public static long fun2(int n){
        if(n==1)
            return fun(1);
        return fun(n)+fun2(n-1);
    }
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        System.out.println(fun1(n));
        System.out.println(fun2(n));
    }
}
